diff --git a/thirdparty/lcms2/include/lcms2mt_plugin.h b/thirdparty/lcms2/include/lcms2mt_plugin.h
--- a/thirdparty/lcms2/include/lcms2mt_plugin.h
+++ b/thirdparty/lcms2/include/lcms2mt_plugin.h
@@ -97,7 +97,7 @@ CMSAPI void               CMSEXPORT _cmsMAT3eval(cmsContext ContextID, cmsVEC3*
 // MD5 low level  -------------------------------------------------------------------------------------
 
 CMSAPI cmsHANDLE          CMSEXPORT cmsMD5alloc(cmsContext ContextID);
-CMSAPI void               CMSEXPORT cmsMD5add(cmsHANDLE Handle, const cmsUInt8Number* buf, cmsUInt32Number len);
+CMSAPI void               CMSEXPORT cmsMD5add(cmsContext ContextID, cmsHANDLE Handle, const cmsUInt8Number* buf, cmsUInt32Number len);
 CMSAPI void               CMSEXPORT cmsMD5finish(cmsContext ContextID, cmsProfileID* ProfileID, cmsHANDLE Handle);
 
 // Error logging  -------------------------------------------------------------------------------------
diff --git a/thirdparty/lcms2/src/cmsmd5.c b/thirdparty/lcms2/src/cmsmd5.c
--- a/thirdparty/lcms2/src/cmsmd5.c
+++ b/thirdparty/lcms2/src/cmsmd5.c
@@ -29,7 +29,7 @@
 #ifdef CMS_USE_BIG_ENDIAN
 
 static
-void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs)
+void byteReverse(cmsContext ContextID, cmsUInt8Number * buf, cmsUInt32Number longs)
 {
     do {
 
@@ -42,7 +42,7 @@ void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs)
 }
 
 #else
-#define byteReverse(buf, len)
+#define byteReverse(ContextID, buf, len)
 #endif
 
 
@@ -166,7 +166,7 @@ cmsHANDLE CMSEXPORT cmsMD5alloc(cmsContext ContextID)
     return (cmsHANDLE) ctx;
 }
 
-void CMSEXPORT cmsMD5add(cmsHANDLE Handle, const cmsUInt8Number* buf, cmsUInt32Number len)
+void CMSEXPORT cmsMD5add(cmsContext ContextID, cmsHANDLE Handle, const cmsUInt8Number* buf, cmsUInt32Number len)
 {
     _cmsMD5* ctx = (_cmsMD5*) Handle;
     cmsUInt32Number t;
@@ -190,7 +190,7 @@ void CMSEXPORT cmsMD5add(cmsHANDLE Handle, const cmsUInt8Number* buf, cmsUInt32N
         }
 
         memmove(p, buf, t);
-        byteReverse(ctx->in, 16);
+        byteReverse(ContextID, ctx->in, 16);
 
         cmsMD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
         buf += t;
@@ -199,7 +199,7 @@ void CMSEXPORT cmsMD5add(cmsHANDLE Handle, const cmsUInt8Number* buf, cmsUInt32N
 
     while (len >= 64) {
         memmove(ctx->in, buf, 64);
-        byteReverse(ctx->in, 16);
+        byteReverse(ContextID, ctx->in, 16);
         cmsMD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
         buf += 64;
         len -= 64;
@@ -225,21 +225,21 @@ void CMSEXPORT cmsMD5finish(cmsContext ContextID, cmsProfileID* ProfileID,  cmsH
     if (count < 8) {
 
         memset(p, 0, count);
-        byteReverse(ctx->in, 16);
+        byteReverse(ContextID, ctx->in, 16);
         cmsMD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
 
         memset(ctx->in, 0, 56);
     } else {
         memset(p, 0, count - 8);
     }
-    byteReverse(ctx->in, 14);
+    byteReverse(ContextID, ctx->in, 14);
 
     ((cmsUInt32Number *) ctx->in)[14] = ctx->bits[0];
     ((cmsUInt32Number *) ctx->in)[15] = ctx->bits[1];
 
     cmsMD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
 
-    byteReverse((cmsUInt8Number *) ctx->buf, 4);
+    byteReverse(ContextID, (cmsUInt8Number *) ctx->buf, 4);
     memmove(ProfileID ->ID8, ctx->buf, 16);
 
     _cmsFree(ContextID, ctx);
@@ -284,7 +284,7 @@ cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPROFILE hProfile)
     if (MD5 == NULL) goto Error;
 
     // Add all bytes
-    cmsMD5add(MD5, Mem, BytesNeeded);
+    cmsMD5add(ContextID, MD5, Mem, BytesNeeded);
 
     // Temp storage is no longer needed
     _cmsFree(ContextID, Mem);

